Skip to content

Voluntary exit msg validation#306

Merged
dknopik merged 2 commits intosigp:unstablefrom
diegomrsantos:voluntary-exit-msg-validation
May 20, 2025
Merged

Voluntary exit msg validation#306
dknopik merged 2 commits intosigp:unstablefrom
diegomrsantos:voluntary-exit-msg-validation

Conversation

@diegomrsantos
Copy link
Member

@diegomrsantos diegomrsantos commented May 7, 2025

Issue Addressed

#277

Proposed Changes

This PR removes the old voluntary_exit module and introduces a standalone duties_tracker crate to fetch voluntary exit duty counts, wiring it into the message validator and ETH clients.

  • Move exit duty logic into duties_tracker and update all crates to depend on it
  • Integrate get_voluntary_exit_duty_count into consensus message validation for Role::VoluntaryExit

@diegomrsantos diegomrsantos force-pushed the voluntary-exit-msg-validation branch from 72c594c to b6030a9 Compare May 9, 2025 17:45
@diegomrsantos diegomrsantos self-assigned this May 9, 2025
@diegomrsantos diegomrsantos requested a review from Copilot May 9, 2025 17:45
@diegomrsantos diegomrsantos marked this pull request as ready for review May 9, 2025 17:45

This comment was marked as outdated.

@cla-assistant
Copy link

cla-assistant bot commented May 13, 2025

CLA assistant check
All committers have signed the CLA.

@diegomrsantos diegomrsantos force-pushed the voluntary-exit-msg-validation branch from c995bf1 to 55c1dce Compare May 20, 2025 08:58
@diegomrsantos diegomrsantos force-pushed the voluntary-exit-msg-validation branch from 55c1dce to 193c159 Compare May 20, 2025 09:01
@diegomrsantos diegomrsantos requested a review from Copilot May 20, 2025 09:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the old voluntary_exit module and introduces a standalone duties_tracker crate to fetch voluntary exit duty counts, wiring it into the message validator and ETH clients.

  • Move exit duty logic into duties_tracker and update all crates to depend on it
  • Integrate get_voluntary_exit_duty_count into consensus message validation for Role::VoluntaryExit
  • Update Cargo.toml and import paths in message_validator, eth, client, and fuzz targets

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
anchor/voluntary_exit/src/lib.rs Remove obsolete modules
anchor/message_validator/src/lib.rs Drop local duties; re-export and depend on new duties_tracker crate
anchor/message_validator/src/consensus_message.rs Add voluntary-exit duty lookup via DutiesProvider
anchor/message_validator/Cargo.toml Add duties_tracker dependency
anchor/fuzz/fuzz_targets/setup.rs Stub get_voluntary_exit_duty_count in fuzz mock
anchor/eth/src/voluntary_exit_processor.rs Switch to duties_tracker::voluntary_exit_tracker types
anchor/eth/src/sync.rs Correct ExitTx import path
anchor/eth/src/lib.rs Expose voluntary_exit_processor module
anchor/eth/src/event_processor.rs Fix import of ExitRequest/ExitTx
anchor/eth/Cargo.toml Add duties_tracker and anchor_validator_store deps; remove old voluntary_exit
anchor/duties_tracker/src/lib.rs Define DutiesProvider::get_voluntary_exit_duty_count
anchor/duties_tracker/src/duties_tracker.rs Wire new voluntary exit tracker into DutiesTracker struct
anchor/duties_tracker/Cargo.toml Rename package to duties_tracker, add new dependencies
anchor/client/src/lib.rs Pass VoluntaryExitTracker into DutiesTracker::new
anchor/client/Cargo.toml Add duties_tracker dep, remove old voluntary_exit
Cargo.toml Include anchor/duties_tracker in workspace modules
Comments suppressed due to low confidence (3)

anchor/message_validator/src/consensus_message.rs:726

  • The stub implementation for get_voluntary_exit_duty_count is present in tests, but there’s no unit test exercising the Role::VoluntaryExit branch of duty_limit. Add a test that injects a fake DutiesProvider and verifies correct handling of voluntary exit duties.
fn get_voluntary_exit_duty_count(&self, _slot: Slot, _pubkey: &PublicKeyBytes) -> u64 {

anchor/message_validator/src/consensus_message.rs:590

  • The variable duty_provider is not defined in this scope. Consider passing a DutiesProvider instance into duty_limit (e.g., via ValidationContext or as a new function parameter) so you can call get_voluntary_exit_duty_count.
duty_provider.get_voluntary_exit_duty_count(slot, &pubkey)

anchor/duties_tracker/src/lib.rs:106

  • Public API methods should include doc comments. Add a /// comment describing what get_voluntary_exit_duty_count returns and under what conditions (e.g., slot resolution, missing data).
fn get_voluntary_exit_duty_count(&self, slot: Slot, pubkey: &PublicKeyBytes) -> u64;

@diegomrsantos diegomrsantos requested a review from dknopik May 20, 2025 09:53
Copy link
Member

@dknopik dknopik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, LGTM! Thanks!

@dknopik dknopik merged commit 9b09ff6 into sigp:unstable May 20, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants